package com.vidyu.businesslayer.businessentities;

import com.vidyu.businesslayer.businesscomponents.Constants;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * User: eyalsa
 * Date: 3/31/13
 * Time: 7:47 PM
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "projects")
public class Project implements Serializable {

    private static final long serialVersionUID = 3277073386701729397L;
    private long id = Constants.NON_VALID_ID;

    private String title;
    private String projDesc;
    private double budget;
    private double daysDuration;
    private long startDate;
    private Status status;
    private double requestedHours;
    private double price;
    private boolean isPerHour;
    private String projectTypeDesc;
//    private Employer employer;

    public Project(){}

    public Project(String title, String projDesc, double budget, double daysDuration, long startDate, Status status,
                   double requestedHours, double price, boolean perHour, String projectTypeDesc) {
        this.title = title;
        this.projDesc = projDesc;
        this.budget = budget;
        this.daysDuration = daysDuration;
        this.startDate = startDate;
        this.status = status;
        this.requestedHours = requestedHours;
        this.price = price;
        isPerHour = perHour;
        this.projectTypeDesc = projectTypeDesc;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "project_id", nullable = false, length = 11)
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Enumerated(EnumType.ORDINAL)
    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public double getRequestedHours() {
        return requestedHours;
    }

    public void setRequestedHours(double requestedHours) {
        this.requestedHours = requestedHours;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public boolean isPerHour() {
        return isPerHour;
    }

    public void setPerHour(boolean perHour) {
        isPerHour = perHour;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setProjDesc(String projDesc) {
        this.projDesc = projDesc;
    }

    public void setBudget(double budget) {
        this.budget = budget;
    }

    public void setDaysDuration(double daysDuration) {
        this.daysDuration = daysDuration;
    }

    public void setStartDate(long startDate) {
        this.startDate = startDate;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getTitle() {
        return title;
    }

    public String getProjDesc() {
        return projDesc;
    }

    public double getBudget() {
        return budget;
    }

    public double getDaysDuration() {
        return daysDuration;
    }

    public long getStartDate() {
        return startDate;
    }

    public String getProjectTypeDesc() {
        return projectTypeDesc;
    }

    public void setProjectTypeDesc(String projectTypeDesc) {
        this.projectTypeDesc = projectTypeDesc;
    }

    //    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
//    public ProjectType getProjectType() {
//        return projectType;
//    }
//
//    public void setProjectType(ProjectType projectType) {
//        this.projectType = projectType;
//    }
//
//    @ManyToOne(fetch = FetchType.EAGER)
//    @JoinColumn(name="employer_id")
//    public Employer getEmployer() {
//        return employer;
//    }
//
//    public void setEmployer(Employer employer) {
//        this.employer = employer;
//    }
}
